package com.catsic.base.utils;

import org.springframework.security.core.context.SecurityContextHolder;

import com.catsic.base.BaseInfo;

public class BaseUtils {
    /** 
     * 获取登录用户信息
     */  
	public static BaseInfo loginUserId(){
		if(SecurityContextHolder.getContext() == null){  
            return null;  
        }  
          
        if(SecurityContextHolder.getContext().getAuthentication() == null){  
            return null;  
        }  
          
        BaseInfo baseUser = (BaseInfo) SecurityContextHolder.getContext().getAuthentication().getPrincipal();

        return baseUser;
	}

}
